﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:my="clr-namespace:GameFrameLibrary"
                    
                    >
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="shared.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- Button -->
    <Style TargetType="Button" >
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontSize" Value="22" />
        <Setter Property="Width" Value="120" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="Border"  CornerRadius="0" BorderThickness="0" Background="Transparent" BorderBrush="Black">
                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" >
                                <Setter.Value>
                                    <ImageBrush ImageSource="Images/ButtonMouseOver.png" />
                                </Setter.Value>
                            </Setter>

                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Button" x:Key="ButtonStyle" >
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontSize" Value="22" />
        <Setter Property="Width" Value="120" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="Border"  CornerRadius="0" BorderThickness="0" Background="Transparent" BorderBrush="Black">
                        <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="Border" Property="Background" >
                                <Setter.Value>
                                    <ImageBrush ImageSource="Images/ButtonMouseOver.png" />
                                </Setter.Value>
                            </Setter>

                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="CommonTextBrush" StartPoint="0.5,0" EndPoint="0.5,1" >
        <GradientStop Color="White" Offset="0" />
        <GradientStop Color="LightBlue" Offset="0.7" />
        <GradientStop Color="Blue" Offset="2" />
    </LinearGradientBrush>

    <Style TargetType="TextBlock" x:Key="TextBlockStyle" >
        <Setter Property="Foreground" Value="{StaticResource CommonTextBrush}" />
        <Setter Property="FontFamily" Value="Buxton Sketch" />
        <Setter Property="Effect" >
            <Setter.Value>
                <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="20" RenderingBias="Quality" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TextBlock" >
        <Setter Property="Foreground" Value="{StaticResource CommonTextBrush}" />
        <Setter Property="FontFamily" Value="Buxton Sketch" />
        <Setter Property="Effect" >
            <Setter.Value>
                <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="20" RenderingBias="Quality" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="my:BoolenButton" >
        <Setter Property="Effect" >
            <Setter.Value>
                <DropShadowEffect Direction="0" ShadowDepth="0" BlurRadius="20" RenderingBias="Quality" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="my:BoolenButton">
                    <Border Name="B">
                        <Grid Name="G">
                            <Label HorizontalAlignment="Center" Foreground="{StaticResource CommonTextBrush}" FontFamily="Buxton Sketch" >
                                <Label.Content>
                                    <ContentPresenter />
                                </Label.Content>
                            </Label>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="true" >
                            <Setter TargetName="G" Property="Background" >
                                <Setter.Value>
                                    <ImageBrush ImageSource="Images/ButtonIsChecked.png" Opacity="0.8" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true" >
                            <Setter TargetName="B" Property="Background" >
                                <Setter.Value>
                                    <ImageBrush ImageSource="Images/ButtonMouseOver.png" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="CommonBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1" Opacity="1">
        <GradientStop Color="Transparent" Offset="0" />
        <GradientStop Color="Blue" Offset="0.38" />
        <GradientStop Color="Transparent" Offset="1" />
    </LinearGradientBrush>

    <!-- SimpleStyles: ListBox -->
    <Style x:Key="{x:Type ListBox}" TargetType="ListBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="95"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Border 
            Name="Border" 
            Background="Transparent"
            BorderBrush="Transparent"
            BorderThickness="1"
            CornerRadius="2">
                        <ScrollViewer 
              Margin="0"
              Focusable="false">
                            <StackPanel Margin="2" IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background"
                      Value="Gray" />
                            <Setter TargetName="Border" Property="BorderBrush"
                      Value="Transparent" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: ListBoxItem -->
    <Style x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="myBorder" BorderThickness="1" CornerRadius="2">
                        <Grid Name="myGrid">
                            <ContentPresenter Name="Content" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.3">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.1">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.3">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: ListBoxItem -->
    <Style x:Key="LogListBoxItem" TargetType="ListBoxItem">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="myBorder" BorderThickness="0,1,0,1" CornerRadius="0">
                        <Grid Name="myGrid">
                            <ContentPresenter Name="Content" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.3">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.1">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0.3">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- SimpleStyles: ListBoxItem -->
    <Style x:Key="SelectorListBoxItem" TargetType="ListBoxItem">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="myBorder" BorderThickness="0,0,0,0" CornerRadius="0">
                        <Grid Name="myGrid">
                            <ContentPresenter Name="Content" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="1">
                                        <GradientStop Color="Transparent" Offset="0" />
                                        <GradientStop Color="Blue" Offset="0.38" />
                                        <GradientStop Color="Transparent" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="False">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="Transparent" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5" Opacity="0">
                                        <GradientStop Color="LightBlue" Offset="0" />
                                        <GradientStop Color="White" Offset="0.5" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="myBorder" Property="BorderBrush" Value="LightBlue" />
                            <Setter TargetName="myGrid" Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1" Opacity="1">
                                        <GradientStop Color="Transparent" Offset="0" />
                                        <GradientStop Color="Blue" Offset="0.38" />
                                        <GradientStop Color="Transparent" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ScrollBar -->
    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border 
            Name="Border"
            Margin="1" 
            CornerRadius="2" 
            BorderThickness="1">
                        <Path 
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              Fill="#444"
              Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
                        <Border.Background>
                            <SolidColorBrush Color="LightBlue" Opacity="0.2" />
                        </Border.Background>
                        <Border.BorderBrush>
                            <SolidColorBrush Color="LightGray" Opacity="0.2" />
                        </Border.BorderBrush>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" >
                                <Setter.Value>
                                    <SolidColorBrush Color="Red" Opacity="0.3" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="Transparent"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border 
            CornerRadius="2" 
            Background="{TemplateBinding Background}"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="18"/>
            </Grid.RowDefinitions>
            <Border Grid.RowSpan="3" CornerRadius="2">
                <Border.Background>
                    <SolidColorBrush Color="Transparent" />
                </Border.Background>
            </Border>
            <RepeatButton 
        Grid.Row="0"                           
        Style="{StaticResource ScrollBarLineButton}"
        Height="18"
        Command="ScrollBar.LineUpCommand"
        Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track 
        Name="PART_Track"
        Grid.Row="1"
        IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource ScrollBarPageButton}"
            Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
            Style="{StaticResource ScrollBarThumb}" 
            Margin="1,0,1,0"  >
                        <Thumb.Background>
                            <SolidColorBrush Color="LightBlue" Opacity="0.2" />
                        </Thumb.Background>
                        <Thumb.BorderBrush>
                            <SolidColorBrush Color="LightGray" Opacity="0.2" />
                        </Thumb.BorderBrush>
                    </Thumb>
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource ScrollBarPageButton}"
            Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
        Grid.Row="3" 
        Style="{StaticResource ScrollBarLineButton}"
        Height="18"
        Command="ScrollBar.LineDownCommand"
        Content="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border
        Grid.ColumnSpan="3"
        CornerRadius="2" 
        Background="#F0F0F0" />
            <RepeatButton 
        Grid.Column="0"                           
        Style="{StaticResource ScrollBarLineButton}"
        Width="18"
        Command="ScrollBar.LineLeftCommand"
        Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track 
        Name="PART_Track"
        Grid.Column="1"
        IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource ScrollBarPageButton}"
            Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb 
            Style="{StaticResource ScrollBarThumb}" 
            Margin="0,1,0,1"  
            Background="Transparent"
            BorderBrush="Transparent" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource ScrollBarPageButton}"
            Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton 
        Grid.Column="3" 
        Style="{StaticResource ScrollBarLineButton}"
        Width="18"
        Command="ScrollBar.LineRightCommand"
        Content="M 0 0 L 4 4 L 0 8 Z"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- SimpleStyles: Slider -->
    <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SliderThumbStyle" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Height" Value="40"/>
        <Setter Property="Width" Value="40"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Image Source="Images/SilderT.png" />
                    <!--<Ellipse 
            Name="Ellipse" 
            Fill="{StaticResource NormalBrush}"
            Stroke="{StaticResource NormalBorderBrush}"
            StrokeThickness="1" />-->
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DarkBrush}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Ellipse" Property="Fill" Value="{StaticResource DisabledBackgroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <LinearGradientBrush x:Key="HSliderBrush" StartPoint="0,0.5" EndPoint="1,0.5" >
        <GradientStop Color="White" Offset="0" />
        <GradientStop Color="Blue" Offset="1" />
    </LinearGradientBrush>

    <ControlTemplate x:Key="HorizontalSlider" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto" MinHeight="{TemplateBinding Slider.MinHeight}"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TickBar 
        Name="TopTick"
        SnapsToDevicePixels="True" 
        Placement="Top"
        Fill="{StaticResource GlyphBrush}"
        Height="4"
        Visibility="Collapsed" />
            <Border 
        Name="TrackBackground"
        Margin="20,0,20,0"
        CornerRadius="2" 
        Height="4"
        Grid.Row="1"
        Background="{StaticResource HSliderBrush}" 
        BorderBrush="LightBlue"
        BorderThickness="1" />
            <Track Grid.Row="1" Name="PART_Track">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.DecreaseLarge" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource SliderThumbStyle}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.IncreaseLarge" />
                </Track.IncreaseRepeatButton>
            </Track>
            <TickBar 
        Name="BottomTick"
        SnapsToDevicePixels="True" 
        Grid.Row="2"
        Fill="{TemplateBinding Foreground}"
        Placement="Bottom"
        Height="4"
        Visibility="Collapsed" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="VerticalSlider" TargetType="{x:Type Slider}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto" MinWidth="{TemplateBinding Slider.MinWidth}"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <TickBar 
        Name="TopTick"
        SnapsToDevicePixels="True" 
        Placement="Left"
        Fill="{StaticResource GlyphBrush}"
        Width="4"
        Visibility="Collapsed" />
            <Border 
        Name="TrackBackground"
        Margin="0"
        CornerRadius="2" 
        Width="4"
        Grid.Column="1"
        Background="{StaticResource HorizontalLightBrush}" 
        BorderBrush="{StaticResource HorizontalNormalBorderBrush}"
        BorderThickness="1" />
            <Track Grid.Column="1" Name="PART_Track">
                <Track.DecreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.DecreaseLarge" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource SliderThumbStyle}" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton 
            Style="{StaticResource SliderButtonStyle}"
            Command="Slider.IncreaseLarge" />
                </Track.IncreaseRepeatButton>
            </Track>
            <TickBar 
        Name="BottomTick"
        SnapsToDevicePixels="True" 
        Grid.Column="2"
        Fill="{TemplateBinding Foreground}"
        Placement="Right"
        Width="4"
        Visibility="Collapsed" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="TickPlacement" Value="TopLeft">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="BottomRight">
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="TickPlacement" Value="Both">
                <Setter TargetName="TopTick" Property="Visibility" Value="Visible"/>
                <Setter TargetName="BottomTick" Property="Visibility" Value="Visible"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="{x:Type Slider}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="MinWidth" Value="104" />
                <Setter Property="MinHeight" Value="21" />
                <Setter Property="Template" Value="{StaticResource HorizontalSlider}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="MinWidth" Value="21" />
                <Setter Property="MinHeight" Value="104" />
                <Setter Property="Template" Value="{StaticResource VerticalSlider}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- SimpleStyles: TabControl -->
    <Style  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid KeyboardNavigation.TabNavigation="Local">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <StackPanel Margin="10,0,10,0" Grid.Row="1" Orientation="Horizontal">
                            <TextBlock Margin="5" Text="Page:" Style="{StaticResource TextBlockStyle}" FontSize="24" />
                            <TabPanel 
              Name="HeaderPanel"
              Panel.ZIndex="1" 
              IsItemsHost="True"
              KeyboardNavigation.TabIndex="1"
                                Margin="5"
              Background="Transparent" />
                        </StackPanel>

                        <Border 
              Name="Border" 
              Grid.Row="0" 
              Background="Transparent" 
              BorderBrush="Transparent" 
              BorderThickness="0" 
              CornerRadius="0" 
              KeyboardNavigation.TabNavigation="Local"
              KeyboardNavigation.DirectionalNavigation="Contained"
              KeyboardNavigation.TabIndex="2" >
                            <ContentPresenter 
                Name="PART_SelectedContentHost"
                Margin="4"
                ContentSource="SelectedContent" />
                        </Border>
                    </Grid>
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!-- SimpleStyles: TabItem -->
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border 
              Name="Border"
              Margin="0,0,0,0" 
              Background="Transparent"
              BorderBrush="Transparent" 
              BorderThickness="1,1,1,1" 
              CornerRadius="2,12,0,0" >
                            <ContentPresenter x:Name="ContentSite"
                VerticalAlignment="Center"
                HorizontalAlignment="Center"
                ContentSource="Header"
                Margin="12,2,12,2"
                RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                    <!--<ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource WindowBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>-->
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>